<%--
  Created by IntelliJ IDEA.
  User: dcwu5
  Date: 2020-06-25
  Time: 17:07
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored="false" %>
<html>
<head>
    <title>resume</title>
    <script type="text/javascript" src="/js/jquery.min.js"></script>

    <script>
        function toupdate(id) {
            window.location.href="./toupdate?id="+id
    }
        function todelete(id) {
            window.location.href="./todelete?id="+id
    }

    $(function () {
            $("#add").bind("click",function () {
                window.location.href="./toadd"
            })

        })
    </script>
</head>
<body>
<div>
    <table>
        <tr>
            <td>id</td>
            <td>姓名</td>
            <td>手机号</td>
            <td>地址</td>
            <td><button id="add" >新增</button></td>
        </tr>
        <c:forEach items="${resumeList}" var="resume">
            <tr id="${resume.id}">
                <th>${resume.id}</th>
                <td>${resume.name}</td>
                <td>${resume.phone}</td>
                <td>${resume.address}</td>
                <td>
                    <button id="update" onclick="toupdate(${resume.id})" value="${resume.id}">编辑</button>
                    <button id="delete" onclick="todelete(${resume.id})" value="${resume.id}">删除</button>
                </td>
            </tr>
        </c:forEach>
    </table>

</div>
</body>
</html>
